HatchShape AddCircle2D
Adds a 2D circle boundary to the HatchShape
Overloads
| public void AddCircle2D(float centerX, float centerY, float centerZ, float radius) |
| public void AddCircle2D(float centerX, float centerY, float centerZ, float radius, float maximumSegmentationError) |
Return value
| void |
Parameters
| float | centerX | The x coordinate of the center |
| float | centerY | The y coordinate of the center |
| float | centerZ | The z coordinate of the center |
| float | radius | The radius of the arc |
| float | maximumSegmentationError | measures how much a curve deviates from a straight line segment between two points on the curve. |
Example
Copy
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);
if (scanDocument != null)
{
VectorImage vectorImage = scanDocument.CreateVectorImage("image1", DistanceUnit.Millimeters);
vectorImage.SetMarkSpeed(1000);
vectorImage.SetJumpSpeed(2000);
vectorImage.SetJumpDelay(100);
vectorImage.SetMarkDelay(100);
//Set Laser Delays
vectorImage.SetLaserOnDelay(10);
vectorImage.SetLaserOffDelay(10);
CircleShape circleShape1 = new CircleShape();
circleShape1.CenterPoint.X = 0.0f;
circleShape1.CenterPoint.Y = 0.0f;
circleShape1.CenterPoint.Z = 0.0f;
circleShape1.Radius = 5;
vectorImage.AddCircle(circleShape1);
CircleShape circleShape2 = new CircleShape();
circleShape2.CenterPoint.X = 2.5f;
circleShape2.CenterPoint.Y = 2.5f;
circleShape2.CenterPoint.Z = 0.0f;
circleShape2.Radius = 5;
vectorImage.AddCircle(circleShape2);
HatchShape hatchShape = new HatchShape();
hatchShape.AddCircle2D(0, 0, 5, 0.5f);
hatchShape.AddCircle2D(2.5f, 2.5f, 5, 0.5f);
hatchShape.AddHatchPatternLine(0.5f, HatchLineBorderGapDirection.Inward, 0.05f,
0, 0, 0, HatchLineStyle.Serpentine, true,
HatchOffsetAlgorithm.DirectOffset, HatchCornerStyle.Sharp);
vectorImage.AddHatch(hatchShape, 0);
scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));
try
{
scanDocument.StartScanning();
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}